%find idx of brushed data from soma location plot in EM dataset
% TargetID=[]
%temp is the brushed data from clipboard



cellNumber=cellNumber+1
for i=1:size(temp,1)
    
    temp2=temp(i,:);
    Xlogical=SomaLocations(:,1)==temp2(1);
    YLogical=SomaLocations(:,2)==temp2(2);
    ZLogical=SomaLocations(:,3)==temp2(3);
    
   all3=Xlogical & YLogical & ZLogical;

   TargetID(all3)=cellNumber;
   
   
end



for i=1:max(TargetID)
    numSynapses(i)=sum(TargetID==i)
end


% make stacked bar plot of target types (non-confirmed mli, mli, pc, golgi
% cell, pli
numberofsynapsespertype=[147 50 18 12 3]';
figure;
bar(1,numberofsynapsespertype,'stacked')